package br.com.grimoire.calc;

import java.math.BigDecimal;

public interface CalcModel {
	
	/** clears inputs and resets operations in course */
	public static final int CLEAR = 0;
	/** adds an input to the next one */
	public static final int ADD = 1;
	/** subtracts an input from the previous one */
	public static final int SUBTRACT = 2;
	/** multiplies an input by the next one */
	public static final int MULTIPLY = 3;
	/** divides an input by the next one */
	public static final int DIVIDE = 4;
	/** gives the answer of a previous calculation */
	public static final int EQUAL = 5;
	/**  */
	public static final int SQRT = 6;
	/**  */
	public static final int PERCENT = 7;
	/**  */
	public static final int INVERT = 9;
	
	/**
	 * Sets the initial state of the calculator.
	 */
	public void init();
	/**
	 * Process an input returning a result according to a given action.
	 * @param input a BigDecimal representing the input value.
	 * @param action an int representing one of the actions defined by constants of this class. 
	 * @return a value according to the input and action.
	 */
	public BigDecimal process(BigDecimal input, int action);
	/**
	 * Process an input returning a result according to a given action.
	 * @param input a Double representing the input value.
	 * @param action an int representing one of the actions defined by constants of this class. 
	 * @return a value according to the input and action.
	 */
	public Double process(Double input, int action);
	/**
	 * Process an action returning a result.
	 * @param action an int representing one of the actions defined by constants of this class. 
	 * @return a value according to the input and action.
	 */
	public BigDecimal process(int action);

}
